package com.summer.test.controller;

import java.util.List;

import org.apache.commons.logging.Log;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.summer.core.annotations.Logger;
import com.summer.core.annotations.ScopeType;
import com.summer.core.controller.EntityQuery;
import com.summer.test.model.SystemFee;


@Component
@Scope(ScopeType.VIEW)
public class SystemFeeList extends EntityQuery<SystemFee> {
	
	@Logger
	private static Log log;
	
	
	private List<SystemFee> listInUse;
	
	public List<SystemFee> getListInUse() {
		if (listInUse == null) {
			initListInUse();
		}
		return listInUse;
	}
	@SuppressWarnings("unchecked")
	public void initListInUse()
	{
		try {
			listInUse = getHt().find("select distinct sf from SystemFee sf where sf.status='1'");
		} catch (Exception e) {
			e.printStackTrace();
			log.error(e);
		}
	}
	
	
	private String COUNT_HQL = "select count(sf) from SystemFee sf ";
	private String HQL = "select distinct sf from SystemFee sf order by sf.id desc";
	public SystemFeeList() {
		setCountHql(COUNT_HQL);
		setHql(HQL);
	}
	
	

}
